package com.abing.oa.controller;

import com.abing.common.controller.BaseController;
import com.abing.common.service.DictService;
import com.abing.common.utils.PageUtils;
import com.abing.common.utils.Query;
import com.abing.oa.service.NotifyRecordService;
import com.abing.oa.service.NotifyService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("/oa/notify")
public class NotifyController extends BaseController {
    @Autowired
    private NotifyService notifyService;
    @Autowired
    private NotifyRecordService notifyRecordService;
    @Autowired
    private DictService dictService;

    @GetMapping()
    @RequiresPermissions("oa:notify:notify")
    String oaNotify() {
        return "oa/notify/notify";
    }

    @GetMapping("/selfNotify")
    String selefNotify() {
        return "oa/notify/selfNotify";
    }

    /**
     * 获取列表
     */
    @ResponseBody
    @GetMapping("/selfList")
    PageUtils selfList(@RequestParam Map<String,Object> params){
        Query query=new Query(params);
        query.put("userId",getUserId());
        return notifyService.selfList(query);
    }


}
